<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>详情</title>
</head>
<script src="/webjars/jquery/3.2.0/jquery.js"></script>
<body>
<!--新增用户-->
<div>
    <p id="userForm">

    <p style="width: 300px;margin: 0 auto;">
        &nbsp; &nbsp;&nbsp; &nbsp;编号： <input type="text" name="uName" th:value="${user.uCode}"><br><br>
        &nbsp; &nbsp;&nbsp; &nbsp;用户： <input type="text" name="uName" th:value="${user.uName}"><br><br>
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<input type="checkbox" name="uType" th:checked="${user.uType == 2 }"
                                                 placeholder=""> 管理员 <br><br>
    &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: black">备注：</span><input type="text" th:value="${user.uMemo}" name="uMemo"
                                                    placeholder=""><br><br>
        <!--  下划线-->
    <hr>
    <p style="text-align: right">
        <input type="button" value="返回列表" onclick="redirectToPage()">
    </p>

    </p>
    </p>
</div>
</body>
</html>
<script th:inline="javascript">

    var carTypes = [[${user.uType}]];

    // 页面跳转函数
    function redirectToPage() {
        window.location.href = "http://localhost:8080/selectAll";
    };


    $(function () {
        // 复选框
        if (carTypes == 2) {
            $("input[name=uType]").attr("checked", true);
        }
    })

</script>